// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '登录'
    },
    component: () => import('@/views/login')
};

export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: () => import('@/common/components/error-page/404.vue')
};

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () => import('@/common/components/error-page/403.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () => import('@/common/components/error-page/500.vue')
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () => import('@/common/components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: () => import('@/views/main.vue'),
    children: [

    ]
};


// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [{
        path: '/home/:id?',
        icon: 'md-apps',
        name: 'home',
        title: '首页',
        component: () => import('@/views/main.vue'),
        children: [{
            path: 'index',
            title: '首页',
            name: 'home_index',
            component: () => import('@/views/home')
        }]
    },
    {
        path: '/whitelist-management',
        icon: 'md-apps',
        name: 'whitelist-management',
        title: '白名单管理',
        component: () => import('@/views/main.vue'),
        children: [{
                path: 'whitelist-audit/index',
                icon: 'md-apps',
                title: '白名单变更审核',
                name: 'whitelist-audit',
                component: () => import('@/views/whitelist-management/whitelist-audit/index.vue')
            },
            {
                path: 'index',
                icon: 'md-apps',
                title: '白名单管理',
                name: 'whitelist_index',
                component: () => import('@/views/whitelist-management/index.vue')
            },
        ]
    },
    {
        path: '/management',
        icon: 'md-apps',
        name: 'management',
        title: '商户管理',
        component: () => import('@/views/main.vue'),

        children: [{
                path: 'user',
                icon: 'md-apps',
                title: '商户管理',
                name: 'management_user',
                component: () => import('@/views/management/user')
            },
            // {
            //     path: 'channel',
            //     icon: 'md-apps',
            //     title: '商户通道变更审核',
            //     name: 'management_channel',
            //     component: () => import('@/views/management/channel')
            // },
            //file
            {
                path: 'file',
                icon: 'md-apps',
                title: '商户资料变更审核',
                name: 'management_file',
                component: () => import('@/views/management/changeFile')
            }
        ]

    },
    {
        path: '/finance',
        icon: 'md-apps',
        name: 'finance',
        title: '财务管理',
        component: () => import('@/views/main.vue'),

        children: [{
                path: 'manage',
                icon: 'md-apps',
                title: '财务管理',
                name: 'finance_manage',
                component: () => import('@/views/finance/manage')
            },
            // {
            //     path: 'income',
            //     icon: 'md-apps',
            //     title: '商户充值收入',
            //     name: 'finance_income',
            //     component: () => import('@/views/finance/income'),
            //     redirect: '/finance/income/',
            //     children: [{
            //             path: '/',
            //             title: '商户充值收入',
            //             name: 'finance_income',
            //             component: () => import('@/views/finance/income/index1.vue'),
            //         },
            //         // {
            //         //     path: 'record',
            //         //     title: '商户充值收入',
            //         //     name: 'finance_income',
            //         //     component: () => import('@/views/finance/record')
            //         // }
            //     ]
            // },

        ]

    },
    {
        path: '/system',
        icon: 'md-apps',
        name: 'system',
        title: '权限管理',
        component: () => import('@/views/main.vue'),
        // children: [
        //     { path: 'user', icon: 'md-apps', title: '用户管理', name: 'system_user', component: () => import('@/views/system/user') },
        //     { path: 'md-apps', icon: 'md-apps', title: '角色管理', name: 'system_role', component: () => import('@/views/system/role') },
        //     // { path: 'resource', icon: 'md-apps', title: '资源管理', name: 'system_resource', component: () => import('@/views/system/resource') },
        //     // { path: 'log', icon: 'md-apps', title: '系统日志', name: 'system_log', component: () => import('@/views/system/log') },
        //     //
        children: [{
                path: 'user',
                icon: 'md-apps',
                title: '用户管理',
                name: 'system_user',
                component: () => import('@/views/system/user')
            },
            // {
            //     path: 'md-apps',
            //     icon: 'md-apps',
            //     title: '角色管理',
            //     name: 'system_role',
            //     component: () => import('@/views/system/role')
            // },
            // {
            //     path: 'resource',
            //     icon: 'md-apps',
            //     title: '资源管理',
            //     name: 'system_resource',
            //     component: () => import('@/views/system/resource')
            // },
            // {
            //     path: 'log',
            //     icon: 'md-apps',
            //     title: '系统日志',
            //     name: 'system_log',
            //     component: () => import('@/views/system/log')
            // },
        ]
    }



];
// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    locking,
    ...appRouter,
    page500,
    page403,
    page404,
];
